<!DOCTYPE html>
<html lang=zh>
<head>
    <meta name="baidu-site-verification" content="lKl7jYajUz" />
    <meta charset="utf-8">
    
    <title>迷失的男孩</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="keywords" content="火龙战士,zhengweishan,郑伟山的博客，bolg,博客">
    <meta name="description" content="Tommcat源码学习（三）–Tomcat_7.0.70停止过程分析Tomcat关闭命令（Linux下，大部分生产环境都是部署在Linux系统下)：
sh shutdown.sh 
执行这个命令之后，tomcat会为我们做了哪些操作呢？下面就来简单分析下。
shutdown.sh代码清单如下：
# Better OS/400 detection: see Bugzilla 31132
os400=">
<meta property="og:type" content="article">
<meta property="og:title" content="迷失的男孩">
<meta property="og:url" content="http://zhengweishan.oschina.io/2017/03/01/（三）Tomcat_7.0.70停止分析/index.html">
<meta property="og:site_name" content="迷失的男孩">
<meta property="og:description" content="Tommcat源码学习（三）–Tomcat_7.0.70停止过程分析Tomcat关闭命令（Linux下，大部分生产环境都是部署在Linux系统下)：
sh shutdown.sh 
执行这个命令之后，tomcat会为我们做了哪些操作呢？下面就来简单分析下。
shutdown.sh代码清单如下：
# Better OS/400 detection: see Bugzilla 31132
os400=">
<meta property="og:updated_time" content="2016-07-04T07:33:54.520Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="迷失的男孩">
<meta name="twitter:description" content="Tommcat源码学习（三）–Tomcat_7.0.70停止过程分析Tomcat关闭命令（Linux下，大部分生产环境都是部署在Linux系统下)：
sh shutdown.sh 
执行这个命令之后，tomcat会为我们做了哪些操作呢？下面就来简单分析下。
shutdown.sh代码清单如下：
# Better OS/400 detection: see Bugzilla 31132
os400=">
    

    
        <link rel="alternate" href="/atom.xml" title="迷失的男孩" type="application/atom+xml" />
    

    
        <link rel="icon" href="/css/images/favicon.ico" />
    

    <link rel="stylesheet" href="/libs/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/libs/open-sans/styles.css">
    <link rel="stylesheet" href="/libs/source-code-pro/styles.css">

    <link rel="stylesheet" href="/css/style.css">

    <script src="/libs/jquery/2.1.3/jquery.min.js"></script>
    
    
        <link rel="stylesheet" href="/libs/lightgallery/css/lightgallery.min.css">
    
    
        <link rel="stylesheet" href="/libs/justified-gallery/justifiedGallery.min.css">
    
    
    
    
        <script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?eb23f1849f20e62c924d275e4edef134";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>

    


</head>

<body>
    <div id="container">
        <header id="header">
    <div id="header-main" class="header-inner">
        <div class="outer">
            <a href="/" id="logo">
                <i class="logo"></i>
                <span class="site-title">迷失的男孩</span>
            </a>
            <nav id="main-nav">
                
                    <a class="main-nav-link" href="/.">主页</a>
                
                    <a class="main-nav-link" href="/archives">归档</a>
                
                    <a class="main-nav-link" href="/categories">分类</a>
                
                    <a class="main-nav-link" href="/tags">标签</a>
                
                    <a class="main-nav-link" href="/about">关于我</a>
                
            </nav>
            
                
                <nav id="sub-nav">
                    <div class="profile" id="profile-nav">
                        <a id="profile-anchor" href="javascript:;">
                            <img class="avatar" src="/css/images/avatar.jpg" />
                            <i class="fa fa-caret-down"></i>
                        </a>
                    </div>
                </nav>
            
            <div id="search-form-wrap">

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
        <button type="submit" class="search-form-submit"></button>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="想要查找什么..." />
            <span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/',
        CONTENT_URL: '/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>
<script src="/js/insight.js"></script>

</div>
        </div>
    </div>
    <div id="main-nav-mobile" class="header-sub header-inner">
        <table class="menu outer">
            <tr>
                
                    <td><a class="main-nav-link" href="/.">主页</a></td>
                
                    <td><a class="main-nav-link" href="/archives">归档</a></td>
                
                    <td><a class="main-nav-link" href="/categories">分类</a></td>
                
                    <td><a class="main-nav-link" href="/tags">标签</a></td>
                
                    <td><a class="main-nav-link" href="/about">关于我</a></td>
                
                <td>
                    
    <div class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
    </div>

                </td>
            </tr>
        </table>
    </div>
</header>

        <div class="outer">
            
                

<aside id="profile">
    <div class="inner profile-inner">
        <div class="base-info profile-block">
            <img id="avatar" src="/css/images/avatar.jpg" />
            <h2 id="name">迷失的男孩</h2>
            <h3 id="title">为API生，为框架死，为debug奋斗一辈子，吃符号亏，上大小写的当，最后死在需求上。</h3>
            <span id="location"><i class="fa fa-map-marker"></i>中国, 北京</span>
            <a id="follow" target="_blank" href="https://github.com/wesley5201314">关注我</a>
        </div>
        <div class="article-info profile-block">
            <div class="article-info-block">
                22
                <span>文章</span>
            </div>
            <div class="article-info-block">
                8
                <span>标签</span>
            </div>
        </div>
        
        <div class="profile-block social-links">
            <table>
                <tr>
                    
                    
                    <td>
                        <a href="https://github.com/wesley5201314" target="_blank" title="github" class=tooltip>
                            <i class="fa fa-github"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="https://git.oschina.net/zhengweishan" target="_blank" title="git" class=tooltip>
                            <i class="fa fa-git"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/css/images/weixin.png" target="_blank" title="weixin" class=tooltip>
                            <i class="fa fa-weixin"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/" target="_blank" title="facebook" class=tooltip>
                            <i class="fa fa-facebook"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="http://weibo.com/wesley5201314" target="_blank" title="weibo" class=tooltip>
                            <i class="fa fa-weibo"></i>
                        </a>
                    </td>
                    
                    <td>
                        <a href="/atom.xml" target="_blank" title="rss" class=tooltip>
                            <i class="fa fa-rss"></i>
                        </a>
                    </td>
                    
                </tr>
            </table>
        </div>
        
    </div>
</aside>

            
            <section id="main"><article id="post-（三）Tomcat_7.0.70停止分析" class="article article-type-post" itemscope itemprop="blogPost">
    <div class="article-inner">
        
        
        
        <div class="article-entry" itemprop="articleBody">
        
            
            <h1 id="Tommcat源码学习（三）–Tomcat-7-0-70停止过程分析"><a href="#Tommcat源码学习（三）–Tomcat-7-0-70停止过程分析" class="headerlink" title="Tommcat源码学习（三）–Tomcat_7.0.70停止过程分析"></a>Tommcat源码学习（三）–Tomcat_7.0.70停止过程分析</h1><p>Tomcat关闭命令（Linux下，大部分生产环境都是部署在Linux系统下)：</p>
<pre><code>sh shutdown.sh 
</code></pre><p>执行这个命令之后，tomcat会为我们做了哪些操作呢？下面就来简单分析下。</p>
<p>shutdown.sh代码清单如下：</p>
<pre><code># Better OS/400 detection: see Bugzilla 31132
os400=false
case &quot;`uname`&quot; in
OS400*) os400=true;;
esac

# resolve links - $0 may be a softlink
PRG=&quot;$0&quot;

while [ -h &quot;$PRG&quot; ] ; do
  ls=`ls -ld &quot;$PRG&quot;`
  link=`expr &quot;$ls&quot; : &apos;.*-&gt; \(.*\)$&apos;`
  if expr &quot;$link&quot; : &apos;/.*&apos; &gt; /dev/null; then
PRG=&quot;$link&quot;
  else
PRG=`dirname &quot;$PRG&quot;`/&quot;$link&quot;
  fi
done

PRGDIR=`dirname &quot;$PRG&quot;`
EXECUTABLE=catalina.sh

# Check that target executable exists
if $os400; then
  # -x will Only work on the os400 if the files are:
  # 1. owned by the user
  # 2. owned by the PRIMARY group of the user
  # this will not work if the user belongs in secondary groups
  eval
else
  if [ ! -x &quot;$PRGDIR&quot;/&quot;$EXECUTABLE&quot; ]; then
echo &quot;Cannot find $PRGDIR/$EXECUTABLE&quot;
echo &quot;The file is absent or does not have execute permission&quot;
echo &quot;This file is needed to run this program&quot;
exit 1
  fi
fi

exec &quot;$PRGDIR&quot;/&quot;$EXECUTABLE&quot; stop &quot;$@&quot;
</code></pre><p>从上面的代码可以看出来，这里和启动文件是一样的，也有主要的两个变量：</p>
<pre><code>PRGDIR：当前shell脚本所在的路径；
EXECUTABLE：脚本catalina.sh
</code></pre><p>从最后一行代码可以知道，执行catalina.sh，并传递参数：stop</p>
<p>catalina.sh 与之相关的代码清单如下：</p>
<pre><code>elif [ &quot;$1&quot; = &quot;stop&quot; ] ; then

  shift

  SLEEP=5
  if [ ! -z &quot;$1&quot; ]; then
    echo $1 | grep &quot;[^0-9]&quot; &gt;/dev/null 2&gt;&amp;1
    if [ $? -gt 0 ]; then
      SLEEP=$1
      shift
    fi
  fi

  FORCE=0
  if [ &quot;$1&quot; = &quot;-force&quot; ]; then
    shift
    FORCE=1
  fi

  if [ ! -z &quot;$CATALINA_PID&quot; ]; then
    if [ -f &quot;$CATALINA_PID&quot; ]; then
      if [ -s &quot;$CATALINA_PID&quot; ]; then
        kill -0 `cat &quot;$CATALINA_PID&quot;` &gt;/dev/null 2&gt;&amp;1
        if [ $? -gt 0 ]; then
          echo &quot;PID file found but no matching process was found. Stop aborted.&quot;
          exit 1
        fi
      else
        echo &quot;PID file is empty and has been ignored.&quot;
      fi
    else
      echo &quot;\$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted.&quot;
      exit 1
    fi
  fi

  eval &quot;\&quot;$_RUNJAVA\&quot;&quot; $LOGGING_MANAGER $JAVA_OPTS \
    -Djava.endorsed.dirs=&quot;\&quot;$JAVA_ENDORSED_DIRS\&quot;&quot; -classpath &quot;\&quot;$CLASSPATH\&quot;&quot; \
    -Dcatalina.base=&quot;\&quot;$CATALINA_BASE\&quot;&quot; \
    -Dcatalina.home=&quot;\&quot;$CATALINA_HOME\&quot;&quot; \
    -Djava.io.tmpdir=&quot;\&quot;$CATALINA_TMPDIR\&quot;&quot; \
    org.apache.catalina.startup.Bootstrap &quot;$@&quot; stop
</code></pre><p>最终使用java命令执行了org.apache.catalina.startup.Bootstrap类中的main方法，参数是stop。</p>
<pre><code> public static void main(String args[]) {

    if (daemon == null) {
        // Don&apos;t set daemon until init() has completed
        Bootstrap bootstrap = new Bootstrap();
        try {
            bootstrap.init();
        } catch (Throwable t) {
            handleThrowable(t);
            t.printStackTrace();
            return;
        }
        daemon = bootstrap;
    } else {
        // When running as a service the call to stop will be on a new
        // thread so make sure the correct class loader is used to prevent
        // a range of class not found exceptions.
        Thread.currentThread().setContextClassLoader(daemon.catalinaLoader);
    }

    try {
        String command = &quot;start&quot;;
        if (args.length &gt; 0) {
            command = args[args.length - 1];
        }

        if (command.equals(&quot;startd&quot;)) {
            args[args.length - 1] = &quot;start&quot;;
            daemon.load(args);
            daemon.start();
        } else if (command.equals(&quot;stopd&quot;)) {
            args[args.length - 1] = &quot;stop&quot;;
            daemon.stop();
        } else if (command.equals(&quot;start&quot;)) {
            daemon.setAwait(true);
            daemon.load(args);
            daemon.start();
        } else if (command.equals(&quot;stop&quot;)) {
            daemon.stopServer(args);
        } else if (command.equals(&quot;configtest&quot;)) {
            daemon.load(args);
            if (null==daemon.getServer()) {
                System.exit(1);
            }
            System.exit(0);
        } else {
            log.warn(&quot;Bootstrap: command \&quot;&quot; + command + &quot;\&quot; does not exist.&quot;);
        }
    } catch (Throwable t) {
        // Unwrap the Exception for clearer error reporting
        if (t instanceof InvocationTargetException &amp;&amp;
                t.getCause() != null) {
            t = t.getCause();
        }
        handleThrowable(t);
        t.printStackTrace();
        System.exit(1);
    }

}
</code></pre><p>当传递参数stop的时候，command等于stop，此时main方法的执行步骤如下：</p>
<ul>
<li>初始化Bootstrap（启动的时候已经介绍过就不在介绍）</li>
<li><p>停止服务</p>
<p>  通过调用Bootstrap的stopServer方法停止Tomcat，其实质是用反射调用catalinaDaemon（类型是Catalina）的stopServer方法。</p>
<pre><code>/**
 * Stop the standalone server.
 */
public void stopServer(String[] arguments)
    throws Exception {

    Object param[];
    Class&lt;?&gt; paramTypes[];
    if (arguments==null || arguments.length==0) {
        paramTypes = null;
        param = null;
    } else {
        paramTypes = new Class[1];
        paramTypes[0] = arguments.getClass();
        param = new Object[1];
        param[0] = arguments;
    }
    Method method =
        catalinaDaemon.getClass().getMethod(&quot;stopServer&quot;, paramTypes);//反射调用catalinaDaemon（类型是Catalina）的stopServer方法
    method.invoke(catalinaDaemon, param);

}
</code></pre><p>  Catalina的stopServer方法的执行步骤如下：</p>
<p>  代码清单：</p>
<pre><code>public void stopServer() {
    stopServer(null);
}

public void stopServer(String[] arguments) {

    if (arguments != null) {
        arguments(arguments);
    }

    Server s = getServer();
    if( s == null ) {//服务不存在
        // Create and execute our Digester
        Digester digester = createStopDigester();//Digester解析server.xml文件，以构造出Server容器
        File file = configFile();
        FileInputStream fis = null;
        try {
            InputSource is =
                new InputSource(file.toURI().toURL().toString());
            fis = new FileInputStream(file);
            is.setByteStream(fis);
            digester.push(this);
            digester.parse(is);
        } catch (Exception e) {
            log.error(&quot;Catalina.stop: &quot;, e);
            System.exit(1);
        } finally {
            if (fis != null) {
                try {
                    fis.close();
                } catch (IOException e) {
                    // Ignore
                }
            }
        }
    } else {
        // Server object already present. Must be running as a service
        try {
            s.stop();
        } catch (LifecycleException e) {
            log.error(&quot;Catalina.stop: &quot;, e);
        }
        return;
    }

    // Stop the existing server
    s = getServer();
    if (s.getPort()&gt;0) {
        Socket socket = null;
        OutputStream stream = null;
        try {
            socket = new Socket(s.getAddress(), s.getPort());//创建Socket对象连接启动Tomcat时创建的ServerSocket
            stream = socket.getOutputStream();
            String shutdown = s.getShutdown();
            for (int i = 0; i &lt; shutdown.length(); i++) {
                stream.write(shutdown.charAt(i));//发送shutdown命令
            }
            stream.flush();
        } catch (ConnectException ce) {
            log.error(sm.getString(&quot;catalina.stopServer.connectException&quot;,
                                   s.getAddress(),
                                   String.valueOf(s.getPort())));
            log.error(&quot;Catalina.stop: &quot;, ce);
            System.exit(1);
        } catch (IOException e) {
            log.error(&quot;Catalina.stop: &quot;, e);
            System.exit(1);
        } finally {
            if (stream != null) {
                try {
                    stream.close();
                } catch (IOException e) {
                    // Ignore
                }
            }
            if (socket != null) {
                try {
                    socket.close();
                } catch (IOException e) {
                    // Ignore
                }
            }
        }
    } else {
        log.error(sm.getString(&quot;catalina.stopServer&quot;));
        System.exit(1);
    }
}
</code></pre></li>
</ul>
<pre><code>-     创建Digester解析server.xml文件（此处只解析标签），以构造出Server容器（此时Server容器的子容器没有被实例化）；
-     从实例化的Server容器获取Server的socket监听端口和地址，然后创建Socket对象连接启动Tomcat时创建的ServerSocket，最后向ServerSocket发送SHUTDOWN命令。根据

        @Override
        public void await() {
            // Negative values - don&apos;t wait on port - tomcat is embedded or we just don&apos;t like ports
            if( port == -2 ) {
                // undocumented yet - for embedding apps that are around, alive.
                return;
            }
            if( port==-1 ) {
                try {
                    awaitThread = Thread.currentThread();
                    while(!stopAwait) {
                        try {
                            Thread.sleep( 10000 );
                        } catch( InterruptedException ex ) {
                            // continue and check the flag
                        }
                    }
                } finally {
                    awaitThread = null;
                }
                return;
            }

            // Set up a server socket to wait on
            try {
                awaitSocket = new ServerSocket(port, 1,
                        InetAddress.getByName(address));//创建socket连接的服务端对象ServerSocket
            } catch (IOException e) {
                log.error(&quot;StandardServer.await: create[&quot; + address
                                   + &quot;:&quot; + port
                                   + &quot;]: &quot;, e);
                return;
            }

            try {
                awaitThread = Thread.currentThread();

                // Loop waiting for a connection and a valid command
                while (!stopAwait) {
                    ServerSocket serverSocket = awaitSocket;
                    if (serverSocket == null) {
                        break;
                    }

                    // Wait for the next connection
                    Socket socket = null;
                    StringBuilder command = new StringBuilder();//创建一个对象循环接收socket中的字符
                    try {
                        InputStream stream;
                        long acceptStartTime = System.currentTimeMillis();
                        try {
                            socket = serverSocket.accept();
                            socket.setSoTimeout(10 * 1000);  // Ten seconds
                            stream = socket.getInputStream();
                        } catch (SocketTimeoutException ste) {
                            // This should never happen but bug 56684 suggests that
                            // it does.
                            log.warn(sm.getString(&quot;standardServer.accept.timeout&quot;,
                                    Long.valueOf(System.currentTimeMillis() - acceptStartTime)), ste);
                            continue;
                        } catch (AccessControlException ace) {
                            log.warn(&quot;StandardServer.accept security exception: &quot;
                                    + ace.getMessage(), ace);
                            continue;
                        } catch (IOException e) {
                            if (stopAwait) {
                                // Wait was aborted with socket.close()
                                break;
                            }
                            log.error(&quot;StandardServer.await: accept: &quot;, e);
                            break;
                        }

                        // Read a set of characters from the socket
                        int expected = 1024; // Cut off to avoid DoS attack
                        while (expected &lt; shutdown.length()) {
                            if (random == null)
                                random = new Random();
                            expected += (random.nextInt() % 1024);
                        }
                        while (expected &gt; 0) {
                            int ch = -1;
                            try {
                                ch = stream.read();
                            } catch (IOException e) {
                                log.warn(&quot;StandardServer.await: read: &quot;, e);
                                ch = -1;
                            }
                            if (ch &lt; 32)  // Control character or EOF terminates loop
                                break;
                            command.append((char) ch);
                            expected--;
                        }
                    } finally {
                        // Close the socket now that we are done with it
                        try {
                            if (socket != null) {
                                socket.close();
                            }
                        } catch (IOException e) {
                            // Ignore
                        }
                    }

                    // Match against our command string

                    boolean match = command.toString().equals(shutdown);
                    if (match) { //如果接收到的命令与SHUTDOWN匹配（由于使用了equals，所以shutdown命令必须是大写的），那么退出循环等待
                        log.info(sm.getString(&quot;standardServer.shutdownViaPort&quot;));
                        break;
                    } else
                        log.warn(&quot;StandardServer.await: Invalid command &apos;&quot;
                                + command.toString() + &quot;&apos; received&quot;);
                }
            } finally {
                ServerSocket serverSocket = awaitSocket;
                awaitThread = null;
                awaitSocket = null;

                // Close the server socket and return
                if (serverSocket != null) {
                    try {
                        serverSocket.close();
                    } catch (IOException e) {
                        // Ignore
                    }
                }
            }
        }
    内容，ServerSocket循环等待接收到SHUTDOWN命令后，最终调用stop方法停止Tomcat。

    最后，我们看看Catalina的stop方法的实现，其执行步骤如下：
    1. 将启动过程中添加的关闭钩子移除。Tomcat启动过程辛辛苦苦添加的关闭钩子为什么又要去掉呢？因为关闭钩子是为了在JVM异常退出后，进行资源的回收工作。主动停止Tomcat时调用的stop方法里已经包含了资源回收的内容，所以不再需要这个钩子了。
    2. 停止Server容器。有关容器的停止内容，请阅读后续文章。
    3. 代码清单：

            /**
             * Stop an existing server instance.****
             */
            public void stop() {

                try {
                    // Remove the ShutdownHook first so that server.stop()
                    // doesn&apos;t get invoked twice
                    if (useShutdownHook) {
                        Runtime.getRuntime().removeShutdownHook(shutdownHook);//将启动过程中添加的关闭钩子移除

                        // If JULI is being used, re-enable JULI&apos;s shutdown to ensure
                        // log messages are not lost
                        LogManager logManager = LogManager.getLogManager();
                        if (logManager instanceof ClassLoaderLogManager) {
                            ((ClassLoaderLogManager) logManager).setUseShutdownHook(
                                    true);
                        }
                    }
                } catch (Throwable t) {
                    ExceptionUtils.handleThrowable(t);
                    // This will fail on JDK 1.2. Ignoring, as Tomcat can run
                    // fine without the shutdown hook.
                }

                // Shut down the server
                try {
                    Server s = getServer();
                    LifecycleState state = s.getState();
                    if (LifecycleState.STOPPING_PREP.compareTo(state) &lt;= 0
                            &amp;&amp; LifecycleState.DESTROYED.compareTo(state) &gt;= 0) {
                        // Nothing to do. stop() was already called
                    } else {
                        s.stop();//停止Server容器。
                        s.destroy();
                    }
                } catch (LifecycleException e) {
                    log.error(&quot;Catalina.stop&quot;, e);
                }

            }

总结：

通过对Tomcat源码的分析我们了解到Tomcat的启动和停止都离不开org.apache.catalina.startup.Bootstrap。
当停止Tomcat时，已经启动的Tomcat作为socket服务端，停止脚本启动的Bootstrap进程作为socket客户端向服务端发送shutdown命令
，两个进程通过共享server.xml里Server标签的端口以及地址信息打通了socket的通信。
</code></pre>
        
        </div>
        <footer class="article-footer">
            <div class="share-container">


    <div class="bdsharebuttonbox">
    <a href="#" class="bds_more" data-cmd="more">分享到：</a>
    <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间">QQ空间</a>
    <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博">新浪微博</a>
    <a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博">腾讯微博</a>
    <a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网">人人网</a>
    <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信">微信</a>
</div>
<script>
window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{"bdSize":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
</script>
<style>
    .bdshare_popup_box {
        border-radius: 4px;
        border: #e1e1e1 solid 1px;
    }
    .bdshare-button-style0-16 a,
    .bdshare-button-style0-16 .bds_more {
        padding-left: 20px;
        margin: 6px 10px 6px 0;
    }
    .bdshare_dialog_list a,
    .bdshare_popup_list a,
    .bdshare_popup_bottom a {
        font-family: 'Microsoft Yahei';
    }
    .bdshare_popup_top {
        display: none;
    }
    .bdshare_popup_bottom {
        height: auto;
        padding: 5px;
    }
</style>


</div>

            
    
        <a href="http://zhengweishan.oschina.io/2017/03/01/（三）Tomcat_7.0.70停止分析/#comments" class="article-comment-link ds-thread-count" data-thread-key="http://zhengweishan.oschina.io/2017/03/01/（三）Tomcat_7.0.70停止分析/">评论</a>
    

        </footer>
    </div>
    
        
<nav id="article-nav">
    
        <a href="/2017/03/01/（四）Tomcat_7.0.70 server.xml文件的加载与解析/" id="article-nav-newer" class="article-nav-link-wrap">
            <strong class="article-nav-caption">上一篇</strong>
            <div class="article-nav-title">
                
                    (no title)
                
            </div>
        </a>
    
    
        <a href="/2017/03/01/（六）Tomcat_7.0.70生命周期管理/" id="article-nav-older" class="article-nav-link-wrap">
            <strong class="article-nav-caption">下一篇</strong>
            <div class="article-nav-title"></div>
        </a>
    
</nav>


    
</article>


    
    <section id="comments">
    
        
    <div class="ds-thread" data-thread-key="2017/03/01/（三）Tomcat_7.0.70停止分析/" data-title="" data-url="http://zhengweishan.oschina.io/2017/03/01/（三）Tomcat_7.0.70停止分析/"></div>
    <style>
        #ds-thread #ds-reset .ds-textarea-wrapper {
            background: none;
        }
        #ds-reset .ds-avatar img {
            box-shadow: none;
        }
        #ds-reset .ds-gradient-bg {
            background: #f7f7f7;
        }
        #ds-thread #ds-reset li.ds-tab a {
            border-radius: 3px;
        }
        #ds-thread #ds-reset .ds-post-button {
            color: white;
            border: none;
            box-shadow: none;
            background: #d32;
            text-shadow: none;
            font-weight: normal;
            font-family: 'Microsoft Yahei';
        }
        #ds-thread #ds-reset .ds-post-button:hover {
            color: white;
            background: #DE594C;
        }
        #ds-thread #ds-reset .ds-post-button:active {
            background: #d32;
        }
        #ds-smilies-tooltip ul.ds-smilies-tabs li a.ds-current {
            color: white;
            background: #d32;
            box-shadow: none;
            text-shadow: none;
            font-weight: normal;
        }
    </style>

    
    </section>

</section>
            
                <aside id="sidebar">
   
        
    <div class="widget-wrap">
        <h3 class="widget-title">最新文章</h3>
        <div class="widget">
            <ul id="recent-post" class="">
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/03/01/kafka学习（四）---- Kafka整合SpringMVC实例（二）/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/2017/03/01/kafka学习（四）---- Kafka整合SpringMVC实例（二）/" class="title"></a></p>
                            <p class="item-date"><time datetime="2017-03-01T08:16:19.035Z" itemprop="datePublished">2017-03-01</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/03/01/kafka学习(一) ---- 基本概念以及环境搭建/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/2017/03/01/kafka学习(一) ---- 基本概念以及环境搭建/" class="title"></a></p>
                            <p class="item-date"><time datetime="2017-03-01T08:16:19.035Z" itemprop="datePublished">2017-03-01</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/03/01/kafka学习（三）---- Kafka整合SpringMVC实例/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/2017/03/01/kafka学习（三）---- Kafka整合SpringMVC实例/" class="title"></a></p>
                            <p class="item-date"><time datetime="2017-03-01T08:16:19.034Z" itemprop="datePublished">2017-03-01</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/03/01/kafka学习（二）---- Kafka简单的Java版本的HelloWorld实例/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/2017/03/01/kafka学习（二）---- Kafka简单的Java版本的HelloWorld实例/" class="title"></a></p>
                            <p class="item-date"><time datetime="2017-03-01T08:16:19.026Z" itemprop="datePublished">2017-03-01</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/2017/03/01/JMS学习（四）Spring和ActiveMQ整合的完整实例/" class="thumbnail">
    
    
        <span class="thumbnail-image thumbnail-none"></span>
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/2017/03/01/JMS学习（四）Spring和ActiveMQ整合的完整实例/" class="title"></a></p>
                            <p class="item-date"><time datetime="2017-03-01T08:16:19.025Z" itemprop="datePublished">2017-03-01</time></p>
                        </div>
                    </li>
                
            </ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">分类</h3>
        <div class="widget">
            <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Elasticsearch/">Elasticsearch</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Hexo/">Hexo</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/JAVA/">JAVA</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/JMS/">JMS</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/JVM/">JVM</a><span class="category-list-count">2</span></li></ul>
        </div>
    </div>

    
        
    <div class="widget-wrap">
        <h3 class="widget-title">标签云</h3>
        <div class="widget tagcloud">
            <a href="/tags/ActiveMQ/" style="font-size: 10px;">ActiveMQ</a> <a href="/tags/Elasticsearch学习/" style="font-size: 15px;">Elasticsearch学习</a> <a href="/tags/GC/" style="font-size: 15px;">GC</a> <a href="/tags/Hexo/" style="font-size: 10px;">Hexo</a> <a href="/tags/JAVA/" style="font-size: 20px;">JAVA</a> <a href="/tags/JMS/" style="font-size: 10px;">JMS</a> <a href="/tags/JVM/" style="font-size: 15px;">JVM</a> <a href="/tags/Reflection/" style="font-size: 10px;">Reflection</a>
        </div>
    </div>

    
        
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">链接</h3>
        <div class="widget">
            <ul>
                
                    <li>
                        <a href="http://hexo.io">Hexo</a>
                    </li>
                
            </ul>
        </div>
    </div>


    
    <div id="toTop" class="fa fa-angle-up"></div>
</aside>
            
        </div>
        <footer id="footer">
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <div class="outer">
        <div id="footer-info" class="inner">
            &copy; 2017 郑伟山 版权所有<br> 
            由 <a href="http://hexo.io/" target="_blank">Hexo</a> 强力驱动 &brvbar; 主题 -- <a href="https://github.com/ppoffice/hexo-theme-icarus">Icarus</a><br>
            
        </div>
		<div class="inner">
        	<span id="busuanzi_container_site_pv">
    			本站总访问量<span id="busuanzi_value_site_pv" class="foot-count"></span>次
			</span> &brvbar;
			<span id="busuanzi_container_site_uv">
  				您是本站第<span id="busuanzi_value_site_uv" class="foot-count"></span>位访客
			</span>
		</div>
    </div>
</footer>
        
    
    <script type="text/javascript">
    var duoshuoQuery = {short_name:'wesley-icarus'};
    (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0]
    || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>



    
        <script src="/libs/lightgallery/js/lightgallery.min.js"></script>
        <script src="/libs/lightgallery/js/lg-thumbnail.min.js"></script>
        <script src="/libs/lightgallery/js/lg-pager.min.js"></script>
        <script src="/libs/lightgallery/js/lg-autoplay.min.js"></script>
        <script src="/libs/lightgallery/js/lg-fullscreen.min.js"></script>
        <script src="/libs/lightgallery/js/lg-zoom.min.js"></script>
        <script src="/libs/lightgallery/js/lg-hash.min.js"></script>
        <script src="/libs/lightgallery/js/lg-share.min.js"></script>
        <script src="/libs/lightgallery/js/lg-video.min.js"></script>
    
    
        <script src="/libs/justified-gallery/jquery.justifiedGallery.min.js"></script>
    



<!-- Custom Scripts -->
<script src="/js/main.js"></script>

    </div>
</body>
</html>